package com.shigen.demo.rocksdb;

import org.rocksdb.Options;
import org.rocksdb.RocksDB;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

// @Configuration
public class RocksDBConfig {

    @Value("${rocksdb.path}")
    private String dbPath;

    @Bean(destroyMethod = "close")
    public RocksDB rocksDB() throws Exception {
        Options options = new Options().setCreateIfMissing(true);
        return RocksDB.open(options, dbPath);
    }
}
